package com.aw.manual.ejemplo8;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.MessageSource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * User: gmc
 * Date: 25/05/2010
 */
@Component
public class Carro {
    private Motor motor;
    private Ventana ventana;
    private Faro faro;
    @Autowired
    private Freno freno;
    @Autowired
    @Qualifier("autoRadioConLectorDeCD")
    private AutoRadio autoRadio;

    private Cenicero cenicero;

    @Autowired
    private Accesorios[] accesorios;

    @Autowired
    private List<Accesorios> accesoriosList;

    @Autowired
    private Map<String, Accesorios> accesoriosMap;

    @Autowired
    private Map<String, Object> todosLosBeansMap;

    @Autowired
    private MessageSource messageSource;

    @Autowired
    private ResourceLoader resourceLoader;

    @Autowired
    private ApplicationContext applicationContext;

    @Autowired
    public Carro(Motor motor) {
        this.motor = motor;
    }

    @Autowired
    public void setVentana(Ventana ventana) {
        this.ventana = ventana;
    }

    public Ventana getVentana() {
        return ventana;
    }

    @Autowired
    public void inicializarFaro(Faro faro) {
        this.faro = faro;
    }

    @Autowired
    public void setCenicero(@Qualifier("ceniceroCromado") Cenicero cenicero) {
        this.cenicero = cenicero;
    }
}
